<template>
	<view class="container">
		<view class="join-btn" :class="isJoined ? 'joined' : 'unjoined'" @click="toggleJoin">
			{{ isJoined ? '已参与（再次点击退出' : '点击参与' }}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isJoined: false
			}
		},
		methods: {
			toggleJoin() {
				this.isJoined = !this.isJoined
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding: 32rpx;
		display: flex;
		justify-content: center;
	}

	.join-btn {
		width: 300rpx;
		height: 100rpx;
		border-radius: 80rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 28rpx;
		font-weight: 500;
		transition: all 0.3s ease;
		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);

		/* 未加入状态样式 */
		&.unjoined {
			background-color: #007AFF;
			color: #FFFFFF;
			border: 2rpx solid #007AFF;

			&:active {
				transform: scale(0.95);
				opacity: 0.9;
			}
		}

		/* 已加入状态样式 */
		&.joined {
			background-color: #F0F0F0;
			color: #999999;
			border: 2rpx solid #E5E5E5;

			&:active {
				transform: scale(0.95);
			}
		}
	}
</style>